package five.SingletonExample;

public class LogHandler {
    private static LogHandler logHandler = new LogHandler();
    private static String log = "";
    private LogHandler(){
        System.out.println("生成了一个日志处理类。");
    }
    public static LogHandler getInstance(){
        return logHandler;
    }
    public static  void write(String string){
        log+=string;
    }
    public static String read(){
        return log;
    }
}